<?php
/**
 * @author shutyuka@gmail.com
 * @modified 2011-02-20
 */
class Staffs{
	
	static public $FLAG_INACTIVE = 0;
	
	static public $FLAG_UNACTIVE = 10;
	
	static public $TABLE_NAME="staffs";

	static public function Create($staff) {
		$staff['create_time'] = time();
		$staff['id'] = DB::Insert(self::$TABLE_NAME, $staff);
		
		return $staff['id'];
	}
	
	static public function Update($staff) {
		Table::UpdateCache(self::$TABLE_NAME, $staff['id'], $staff);
		
		return ;
	}

	static public function SetStaffUnactive($staffId) {
		if (!$staffId) 
			return array();
		Table::UpdateCache(self::$TABLE_NAME, $staffId, array(
			'activity' => self::$FLAG_UNACTIVE)
		);
		return ;
	}
	
	
	static public function SetStaffInActive($staffId) {
		if (!$staffId) 
			return array();
		Table::UpdateCache(self::$TABLE_NAME, $staffId, array(
			'activity' => self::$FLAG_INACTIVE)
		);
		return ;
	}
	
}
